<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Chapter&#160;2.&#160;Boost.Align</title>
<link rel="stylesheet" href="../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="libraries.html" title="Part&#160;I.&#160;The Boost C++ Libraries (BoostBook Subset)">
<link rel="prev" href="boost/numeric/functional/as_one_T__std__idp68203728.html" title="Struct template as_one&lt;T, std_vector_tag&gt;">
<link rel="next" href="align/rationale.html" title="Rationale">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../boost.png"></td>
<td align="center"><a href="../../index.html">Home</a></td>
<td align="center"><a href="../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="boost/numeric/functional/as_one_T__std__idp68203728.html"><img src="../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="libraries.html"><img src="../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="align/rationale.html"><img src="../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="chapter">
<div class="titlepage"><div>
<div><h2 class="title">
<a name="align"></a>Chapter&#160;2.&#160;Boost.Align</h2></div>
<div><div class="author"><h3 class="author">
<span class="firstname">Glen</span> <span class="surname">Fernandes</span>
</h3></div></div>
<div><p class="copyright">Copyright &#169; 2014 Glen Fernandes</p></div>
<div><div class="legalnotice">
<a name="align.legal"></a><p>
        Distributed under the <a href="http://boost.org/LICENSE_1_0.txt" target="_top">Boost
        Software License, Version 1.0</a>.
      </p>
</div></div>
</div></div>
<div class="toc">
<p><b>Table of Contents</b></p>
<dl class="toc">
<dt><span class="section"><a href="align.html#align.introduction">Introduction</a></span></dt>
<dt><span class="section"><a href="align/rationale.html">Rationale</a></span></dt>
<dt><span class="section"><a href="align/tutorial.html">Tutorial</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="align/tutorial.html#align.tutorial.using_align">Using align</a></span></dt>
<dt><span class="section"><a href="align/tutorial.html#align.tutorial.using_aligned_alloc">Using aligned_alloc</a></span></dt>
<dt><span class="section"><a href="align/tutorial.html#align.tutorial.using_aligned_allocator">Using aligned_allocator</a></span></dt>
<dt><span class="section"><a href="align/tutorial.html#align.tutorial.using_aligned_allocator_adaptor">Using
      aligned_allocator_adaptor</a></span></dt>
<dt><span class="section"><a href="align/tutorial.html#align.tutorial.using_aligned_delete">Using aligned_delete</a></span></dt>
<dt><span class="section"><a href="align/tutorial.html#align.tutorial.using_alignment_of">Using alignment_of</a></span></dt>
<dt><span class="section"><a href="align/tutorial.html#align.tutorial.using_is_aligned">Using is_aligned</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="align/examples.html">Examples</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="align/examples.html#align.examples.aligned_ptr_and_make_aligned">aligned_ptr
      and make_aligned</a></span></dt>
<dt><span class="section"><a href="align/examples.html#align.examples.aligned_vector">aligned_vector</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="align/reference.html">Reference</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="align/reference.html#header.boost.align_hpp">Header &lt;boost/align.hpp&gt;</a></span></dt>
<dt><span class="section"><a href="align/reference.html#header.boost.align.align_hpp">Header &lt;boost/align/align.hpp&gt;</a></span></dt>
<dt><span class="section"><a href="align/reference.html#header.boost.align.aligned_alloc_hpp">Header &lt;boost/align/aligned_alloc.hpp&gt;</a></span></dt>
<dt><span class="section"><a href="align/reference.html#header.boost.align.aligned_allocator_hpp">Header &lt;boost/align/aligned_allocator.hpp&gt;</a></span></dt>
<dt><span class="section"><a href="align/reference.html#header.boost.align.aligned_allocator_adaptor_hpp">Header &lt;boost/align/aligned_allocator_adaptor.hpp&gt;</a></span></dt>
<dt><span class="section"><a href="align/reference.html#header.boost.align.aligned_allocator_adaptor_forward_hpp">Header &lt;boost/align/aligned_allocator_adaptor_forward.hpp&gt;</a></span></dt>
<dt><span class="section"><a href="align/reference.html#header.boost.align.aligned_allocator_forward_hpp">Header &lt;boost/align/aligned_allocator_forward.hpp&gt;</a></span></dt>
<dt><span class="section"><a href="align/reference.html#header.boost.align.aligned_delete_hpp">Header &lt;boost/align/aligned_delete.hpp&gt;</a></span></dt>
<dt><span class="section"><a href="align/reference.html#header.boost.align.aligned_delete_forward_hpp">Header &lt;boost/align/aligned_delete_forward.hpp&gt;</a></span></dt>
<dt><span class="section"><a href="align/reference.html#header.boost.align.alignment_of_hpp">Header &lt;boost/align/alignment_of.hpp&gt;</a></span></dt>
<dt><span class="section"><a href="align/reference.html#header.boost.align.alignment_of_forward_hpp">Header &lt;boost/align/alignment_of_forward.hpp&gt;</a></span></dt>
<dt><span class="section"><a href="align/reference.html#header.boost.align.is_aligned_hpp">Header &lt;boost/align/is_aligned.hpp&gt;</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="align/vocabulary.html">Vocabulary</a></span></dt>
<dd><dl><dt><span class="section"><a href="align/vocabulary.html#align.vocabulary.3_11___basic_align__">3.11 [basic.align]</a></span></dt></dl></dd>
<dt><span class="section"><a href="align/compatibility.html">Compatibility</a></span></dt>
<dt><span class="section"><a href="align/acknowledgments.html">Acknowledgments</a></span></dt>
<dt><span class="section"><a href="align/history.html">History</a></span></dt>
<dd><dl><dt><span class="section"><a href="align/history.html#align.history.version_1_0">Version 1.0</a></span></dt></dl></dd>
</dl>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="align.introduction"></a><a class="link" href="align.html#align.introduction" title="Introduction">Introduction</a>
</h2></div></div></div>
<p>
      This library provides function <span class="bold"><strong>align</strong></span> for implementations
      which do not have the C++11 standard library <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">align</span></code> function
      available.
    </p>
<p>
      It provides allocation and deallocation functions, <span class="bold"><strong>aligned_alloc</strong></span>
      and <span class="bold"><strong>aligned_free</strong></span>, as their functionality is
      not yet available in the C++ standard library. They use platform specific functions,
      if available, or use standard library functions in conjunction with <code class="computeroutput"><span class="identifier">align</span></code>.
    </p>
<p>
      It provides C++ allocators, class templates <span class="bold"><strong>aligned_allocator</strong></span>
      and <span class="bold"><strong>aligned_allocator_adaptor</strong></span>, which respect
      alignment. The first uses <code class="computeroutput"><span class="identifier">aligned_alloc</span></code>
      and <code class="computeroutput"><span class="identifier">aligned_free</span></code> while the
      second uses the allocator in conjunction with <code class="computeroutput"><span class="identifier">align</span></code>.
    </p>
<p>
      It provides a deleter, class <span class="bold"><strong>aligned_delete</strong></span>,
      which makes use of <code class="computeroutput"><span class="identifier">aligned_free</span></code>.
      It is suitable for use with constructed objects allocated with <code class="computeroutput"><span class="identifier">aligned_alloc</span></code>.
    </p>
<p>
      It provides type trait <span class="bold"><strong>alignment_of</strong></span> for implementations
      without a conforming C++11 standard library <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">alignment_of</span></code>
      type trait.
    </p>
<p>
      It also provides function <span class="bold"><strong>is_aligned</strong></span> to test
      the alignment of a pointer.
    </p>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"><p><small>Last revised: July 29, 2014 at 09:04:14 GMT</small></p></td>
<td align="right"><div class="copyright-footer"></div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="boost/numeric/functional/as_one_T__std__idp68203728.html"><img src="../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="libraries.html"><img src="../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="align/rationale.html"><img src="../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
